[Player Counter] Use uuid for avatar image#129
Conversation
📝 WalkthroughWalkthroughThe avatar image URL in the Players table is now generated using each player's unique ID instead of their name when constructing the cravatar.eu image path. ChangesAvatar Image URL Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This won't work. For one you didn't edit the "is_whitelisted" check so it will still compare the username with the uuid. Also, the uuid isn't always known - depending on ping or query. |
|
(webedit pr issue) fixed it, should be correctly doing it now |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@player-counter/src/Filament/Server/Pages/PlayersPage.php`:
- Around line 141-143: The ImageColumn state currently uses $record['id'] which
may be the player name not a UUID; update the state closure in PlayersPage (the
ImageColumn::make('avatar')->state(...)) to prefer a real UUID field (e.g.,
$record['uuid'] or whatever MinecraftJavaQueryTypeSchema provides) and only fall
back to $record['id'] if no UUID exists or it does not match a UUID pattern;
ensure you reference the upstream GameQuery::runQuery /
MinecraftJavaQueryTypeSchema mapping so the state uses the canonical UUID when
present and otherwise uses a deterministic fallback (player name) so avatars
remain stable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e54ca83-fa47-4c1f-a11c-9911e53d385c
📒 Files selected for processing (1)
player-counter/src/Filament/Server/Pages/PlayersPage.php
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: PHPStan (8.3)
- GitHub Check: PHPStan (8.4)
- GitHub Check: PHPStan (8.2)
- GitHub Check: PHPStan (8.5)
on query protocol name is the uuid (so should be fine), but ping gives reliable-enough uuid (unless client disables) |
UUID is stable, usernames are not.
Summary by CodeRabbit